home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presentation Library 1993 Spring / ARPL-Spring-93-Partner-Edition.iso / Applications / Word Processing / WordPerfect 2.1 Demo / WordPerfect / WordPerfect.rsrc / PREC_103 < prev    next >
Encoding:
Text File  |  1992-05-27  |  8.0 KB  |  237 lines

  1. %wpdr_dict ©1990-1991 WPCORP. 
  2. /wpdr_dict 134 dict def
  3. wpdr_dict begin
  4. /T true def
  5. /F false def
  6. /bdf{bind def}bind def/xdf{exch def}bdf/mxdf{matrix def}bdf
  7. /ddf{wpdr_dict 3 1 roll exch put}bdf
  8. /ObjectTM mxdf
  9. /sTM mxdf
  10. /crTM mxdf
  11. /dget{wpdr_dict exch get}bdf
  12. /wpvrs{
  13.     /DocName xdf
  14.     /Font xdf
  15.     /FontSize ddf
  16.     /TB ddf
  17.     /TG ddf
  18.     /TR ddf
  19.     /LineSize ddf
  20.     /ColumnRMar ddf
  21.     /ColumnLMar ddf
  22.     /Columns ddf
  23.     /Column ddf
  24.     /InColumns ddf
  25.     /Chapter ddf
  26.     /RightMargin ddf
  27.     /LeftMargin ddf
  28.     /BottomMargin ddf
  29.     /TopMargin ddf
  30.     /Page# ddf
  31.     /Page ddf    
  32.     /PageHeight ddf
  33.     /PageWidth ddf
  34.     /AV ddf
  35.     /AH ddf
  36. }bdf
  37. /drvrs{
  38.      wpdr_dict /ObjectTM get astore [1 0 0 -1 0 PageHeight] 1 index concatmatrix pop
  39.     /BxT ddf
  40.     /BxR ddf
  41.     /BxB ddf
  42.     /BxL ddf
  43.     /FBB ddf
  44.     /FBG ddf
  45.     /FBR ddf
  46.     /FFB ddf
  47.     /FFG ddf
  48.     /FFR ddf
  49.     /BBB ddf
  50.     /BBG ddf
  51.     /BBR ddf
  52.     /BFB ddf
  53.     /BFG ddf
  54.     /BFR ddf
  55.     ObjectTM[BxR BxL sub 100 div 0 0 BxT BxB sub 100 div BxL BxT]exch dup concatmatrix pop
  56. }bdf
  57. /ObjectSpace{/crTM dget setmatrix/sTM dget concat AH neg AV neg translate p2p ObjectTM concat 0 -100 translate}bdf
  58. /GridSize{GSX GSY}bdf
  59. /ObjectBounds{BxL BxB BxR BxT}bdf
  60. /PenForeColor{BFR BFG BFB}bdf
  61. /PenBackColor{BBR BBG BBB}bdf
  62. /FillForeColor{FFR FFG FFB}bdf
  63. /FillBackColor{FBR FBG FBB}bdf
  64. /p2p{AH AV PageHeight add translate 1 -1 scale}bdf
  65. /TextColor{TR TG TB}bdf
  66. /OrientTopLeft{0 PageHeight translate 1 -1 scale}bdf
  67. /s2 2 string def
  68. /s16 16 string def
  69. /whitepat<0000000000000000>def
  70. /blackpat<FFFFFFFFFFFFFFFF>def
  71. /fstr (11111111111111111111111111111111) def
  72. /bstr (00000000000000000000000000000000) def
  73. /strlen 32 def
  74. /dim 16 def
  75. /tm mxdf
  76. /box 4 array def
  77. systemdict/setcolorscreen known not{
  78.     /setcolorscreen{12 3 roll 9{pop}repeat setscreen}bdf
  79. }if
  80. /ssp{dup mul exch dup mul add 1 exch sub}bdf
  81. systemdict/currentcolorscreen known{
  82.     /sscr{ %set angles to 75 15 45 0, set frequency to 72
  83.         currentcolorscreen 72 75 11 index 72 15 11 index 72 45 11 index 72 0 11 index
  84.         24 12 roll 12{pop}repeat setcolorscreen
  85.     }bdf
  86.  /sds{75 75 /ssp load 75 15 /ssp load 75 45 /ssp load 75 0 /ssp load setcolorscreen}bdf
  87. }{
  88.     /sscr{currentscreen 3 1 roll pop pop 72 exch 0 exch setscreen}bdf
  89.  /sds{75 45 /ssp load setscreen}bdf
  90. }ifelse
  91. /ctm matrix currentmatrix def
  92. /setctm{ctm setmatrix}bdf
  93. /cvfn{{}forall 14 -2 0 {s16 exch 3 -1 roll 16 s2 cvrs putinterval}for s16}bdf
  94. /patdef{
  95.     9 dict begin
  96.         dup
  97.         /FontPat exch 8 string copy def
  98.         /FontName exch cvfn def
  99.         /FontBBox[0 0 dim dup]def
  100.         /FontMatrix [8 0 0 -8 0 0]dup invertmatrix def
  101.         /Encoding StandardEncoding def
  102.         /FontType 3 def
  103.         /BuildChar{
  104.             exch begin 
  105.                 FontBBox 2 get 0 FontBBox aload pop setcachedevice
  106.                 dup 49 gt 
  107.                     {}
  108.                     {
  109.                         dup 48 lt 
  110.                         {}
  111.                         {
  112.                             49 eq dim dup 3 -1 roll[1 0 0 1 0 0][0]dup
  113.                             32 string 0 FontPat{
  114.                                 2{
  115.                                     3 copy put 3 copy exch 16 add exch put exch 1 add exch
  116.                                 }repeat pop
  117.                             }forall pop
  118.                             0 exch put cvx 
  119.                             imagemask
  120.                         }ifelse
  121.                     }ifelse                
  122.             end % Font_Dict
  123.         }def % BuildChar
  124.         FontName currentdict definefont 
  125.     end % font
  126. }bdf % defpat
  127. /patfill{
  128.     dup whitepat eq{
  129.         pop exch not{{fill}{eofill}ifelse}{pop}ifelse
  130.     }{
  131.         dup blackpat eq{
  132.             pop exch{{fill}{eofill}ifelse}{pop}ifelse
  133.         }{
  134.             exch{clip}{eoclip}ifelse
  135.             dup cvfn dup FontDirectory exch known
  136.                 {exch pop findfont}
  137.                 {pop patdef}
  138.             ifelse 8 scalefont
  139.             setctm sscr
  140.             exch{/str fstr def}{/str bstr def}ifelse
  141.             begin
  142.                 currentdict setfont 
  143.                 FontMatrix concat
  144.                 dim 0 dtransform 0 dim dtransform 
  145.                 box astore {round dim div}forall
  146.                 0 0 transform round exch round exch
  147.                 tm astore setmatrix FontMatrix tm invertmatrix pop 
  148.                 pathbbox
  149.                 dim div ceiling exch dim div ceiling 4 2 roll 
  150.                 dim div floor exch dim div floor exch 4 2 roll
  151.                 3 index sub cvi exch 2 index sub cvi 4 2 roll
  152.                 dim mul exch dim mul exch
  153.                 moveto
  154.                 {
  155.                     gsave
  156.                         tm concat dup strlen idiv {
  157.                             str show
  158.                         } repeat
  159.                         str 0 2 index strlen mod getinterval show
  160.                     grestore
  161.                     0 dim rmoveto
  162.                 } repeat
  163.                 pop
  164.             end
  165.         }ifelse
  166.     }ifelse
  167. }bdf % patfill
  168. /distance{dup mul exch dup mul add sqrt}bdf
  169. /inc{dup cvx 1 add def}bdf
  170. /matdist{aload pop pop pop exch 4 1 roll distance 3 1 roll distance}bdf
  171. /matratio{matdist 3 -1 roll matdist exch 4 1 roll div 3 1 roll exch div}bdf
  172. /setuserscreendict 17 dict def setuserscreendict begin
  173.     /tempctm mxdf/tempscale mxdf
  174.     /concatproc{/proc2 exch cvlit def/proc1 exch cvlit def/newproc proc1 length proc2 length add array def
  175.         newproc 0 proc1 putinterval newproc proc1 length proc2 putinterval newproc cvx}def
  176.     /resmatrix mxdf
  177.     /findresolution{72 0 resmatrix defaultmatrix dtransform/yres xdf/xres xdf xres yres distance}def
  178. end
  179. /setuserscreen{setuserscreendict begin/spotfunction xdf/cellsize xdf/m tempctm currentmatrix def/sm cellsize dup tempscale scale def
  180.     sm m m concatmatrix pop 1 0 m dtransform /y1 exch def /x1 exch def/veclength x1 y1 distance def
  181.     /frequency findresolution veclength div def/newscreenangle y1 x1 atan def
  182.     m 2 get m 1 get mul m 0 get m 3 get mul sub 0 gt{{neg}/spotfunction load concatprocs/spotfunction exch def}if
  183.     frequency newscreenangle/spotfunction load setscreen end}def
  184. /setpatterndict 18 dict def setpatterndict begin
  185.     /bitson{/ybit xdf/xbit xdf/bytevalue bstring ybit bwidth mul xbit 8 idiv add get def
  186.         /mask 1 7 xbit 8 mod sub bitshift def bytevalue mask and 0 ne}def
  187. end
  188. /bitpatternspotfunction{setpatterndict begin
  189.     /y xdf/x xdf/xindex x 1 add 2 div bpside mul cvi def/yindex y 1 add 2 div bpside mul cvi def
  190.     xindex yindex bitson{/onbits onbits 1 add def 1}{/offbits offbits 1 add def 0}ifelse end}def
  191. /setpattern
  192. {setpatterndict begin
  193.     /cellsz xdf/bwidth xdf/bpside xdf/bstring xdf/onbits 0 def/offbits 0 def cellsz/bitpatternspotfunction load
  194.     setuserscreen{}settransfer offbits offbits onbits add div setgray end}def
  195. /in{72 mul}bdf
  196. /cm{28.34646 mul}bdf
  197. /picas{12 mul}bdf
  198. /pic{12 mul}bdf
  199. /ddt{1.06554 mul}bdf
  200. /ccr{12.78652 mul}bdf
  201. /stringtype{8 1 72 300 32 div div setpattern}bdf
  202. /integertype{setgray}bdf
  203. /makepattern{dup type exec}bdf
  204. /renderdict 20 dict def
  205. renderdict begin
  206. /nm mxdf/cm mxdf
  207. end
  208. /fix{m itransform}bdf
  209. /d2{sub 2 div}bdf
  210. /zxdf{exch dup 0 eq{pop .001}if def}bdf
  211. /showpage{}def
  212. /doarc{fix 2 copy mark 7 3 roll 1 arcto cleartomark}bdf
  213. /savematrices{renderdict begin gsave concat /cm cm currentmatrix def grestore gsave concat sds}bdf
  214. /renderpath{
  215.     {gsave setrgbcolor T F 5 index patfill setrgbcolor F exch F exch patfill grestore
  216.     }if{setrgbcolor 6 4 roll cm setmatrix scale 1 setlinewidth 3 index whitepat eq{
  217.     setrgbcolor stroke pop}{3 index blackpat eq{stroke pop pop pop pop}{
  218.     strokepath T T 5 index patfill setrgbcolor F exch T exch patfill}ifelse
  219.     }ifelse}if grestore end
  220. }bdf
  221. /drawrect{savematrices/b xdf/r xdf/u xdf/l xdf newpath l u moveto r u lineto r b lineto l b lineto closepath renderpath}bdf
  222. /drawroundrect{savematrices/b xdf/r xdf/u xdf/l xdf/ry zxdf/rx zxdf newpath l b u d2 u add moveto/m rx ry tm scale def m concat mark l u fix r u doarc r b doarc l b doarc l u doarc closepath cleartomark renderpath}bdf
  223. /drawoval{savematrices/b xdf/r xdf/u xdf/l xdf newpath l b u d2 u add moveto /m r l d2 b u d2 tm scale def m concat mark l u fix r u doarc r b doarc l b doarc l u doarc closepath cleartomark renderpath}bdf
  224. /drawarc{savematrices/cy xdf/cx xdf/ry zxdf/rx zxdf/l xdf/b xdf/u xdf newpath /r xdf/m rx ry tm scale def 
  225. m concat cx cy fix 1 b l arc r{u 0 eq{cx cy fix lineto}if closepath}{u 0 eq{dup{gsave
  226. cx cy fix lineto closepath 8 copy pop setrgbcolor T F 5 index patfill setrgbcolor F exch F exch patfill
  227. grestore}if}if}ifelse renderpath}bdf
  228. /drawbezier{savematrices/u xdf aload pop /cy xdf/cx xdf/ry xdf/rx xdf newpath rx ry moveto 
  229. counttomark 2 sub{3 -1 roll aload pop 6 2 roll 4 2 roll 8 2 roll curveto}repeat 
  230. u{cx cy rx ry curveto closepath}{pop pop}ifelse pop renderpath}bdf
  231. /drawpoly{savematrices/u xdf newpath aload pop moveto counttomark {aload pop lineto}repeat u{closepath}if pop renderpath}bdf
  232. /drawline{savematrices newpath 4 2 roll moveto lineto T F renderpath}bdf
  233. /drawEPS{gsave pop concat 0 exch translate 1 -1 scale 0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit [] 0 setdash newpath userdict begin
  234. }bdf/endEPS{end grestore}bdf
  235. /drawPS{gsave /sTM xdf pop/crTM crTM currentmatrix def p2p}bdf/endPS{grestore}bdf
  236. end
  237.